package com.PVZ.model.zombie;

import com.PVZ.model.Anime;
import com.PVZ.model.emuns.AnimeType;
import com.PVZ.model.emuns.Configs;
import com.PVZ.model.emuns.MoveType;
import com.PVZ.model.emuns.ZombieType;
import com.PVZ.utils.Util;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author ISY
 * @create 2021-06-22 22:18
 */
public class FootballZombie extends Zombie {
    public FootballZombie(int row, int col, MoveType moveType){
        super(ZombieType.FootballZombie,row,col,-70,-90,2);
        this.setMoveType(moveType);
        this.setHealth(Configs.zombieHealth.get(ZombieType.FootballZombie));
        this.setBoxPadding(-20,-20 , -20, -20);
        //this.setTransformZombies(Configs.zombieHealth.get(ZombieType.FootballZombie)/2);
        setAnime();
    }
    public FootballZombie(){
        super(ZombieType.FlagZombie);
        this.setHealth(Configs.zombieHealth.get(ZombieType.FootballZombie));
        this.setImgSrc("res/img/zombiePng/FootballZombie/move/Zombie_football-1.png");
       // this.setTransformZombies(Configs.zombieHealth.get(ZombieType.FootballZombie)/2);
        setAnime();
    }

    @Override
    public void setAnime() {
        Map<AnimeType, Anime> animeMap=new HashMap<>();
        //图片文件夹地址
        String src="res/img/zombiePng/FootballZombie/move";

        int starIndex=1;
        int endIndex=30;

        Anime anime=Util.createAnime(src, "Zombie_football", starIndex, endIndex, -1);


        animeMap.put(AnimeType.MOVE, anime);
        //animeMap.put(AnimeType.MOVECHANGE, getChangeMoveAnime());
        animeMap.put(AnimeType.BREAK,getBreakAnime());
        animeMap.put(AnimeType.ATTACK,getAttackAnime());


        setAnimeMap(animeMap);

    }

//    public Anime getChangeMoveAnime(){
//        String src="res/img/zombiePng/PaperZombie/move_nopaper";
//
//        int starIndex=1;
//        int endIndex=41;
//
//        return Util.createAnime(src, "PaperZombie_move_nopaper", starIndex, endIndex, -1);
//    }

    public Anime getBreakAnime(){
        String src="res/img/zombiePng/FootballZombie/die";

        int starIndex=1;
        int endIndex=18;

        return Util.createAnime(src, "Zombie_football", starIndex, endIndex, 1);
    }

    public Anime getAttackAnime() {
        String src="res/img/zombiePng/FootballZombie/eat";

        int starIndex=1;
        int endIndex=36;

        return Util.createAnime(src, "Zombie_football", starIndex, endIndex, -1);
    }


}
